//校验用户名和密码格式
const checkUsernameAndPassword = (username,password) => {
    //6-16位（字母，数字）
    const usernameReg = new RegExp('^[a-zA-Z0-9]{5,10}$')
    //8-18位（字母数字下划线）^(?![0-9]+$)
    const passwordReg = new RegExp('^[a-zA-Z0-9_]{5,12}$')
    let resOfUser = usernameReg.test(username);
    let resOfPwd = passwordReg.test(password);
    if(resOfUser&&resOfPwd){
        //校验通过
        return true;
    }else{
        return false;
    }

}

//加密

export default checkUsernameAndPassword
